<?php
/**
NOTE: USING STANDARD HTML FORM, FOUND CONFLICT WHEN USING FORM HELPER TO OPEN FORM

**/
	
?>
<div class="grid_9">
<div class="inner-border">
<h6>Select Subjects</h6>

    <form action="<?php echo site_url('student/add_subjects'); ?>" method="post" accept-charset="utf-8" name="select_subjects" class="admin-form" id="select_subjects">
    
        <ul class="course-list">
        <?php foreach($db_entries as $db_entry):?>
            <li class="input-block">
            <?php 
                $data = array(
                    'name'        => 'selectedsubjects[]',
                    'value'       => $db_entry->id,
                );
                echo form_checkbox($data).'<span>'.$db_entry->subject_name.'</span>';
            ?>
            </li>
        <?php endforeach;?>
        </ul>
    <div class="input-block">
    <?php echo form_submit('add', 'Add'); ?>
    </div>
    
    </form>
</div>


<div class="inner-border">
<h6>Selected Subjects</h6>
<?php if(!empty($db_entries2)): ?>
    <form action="<?php echo site_url('student/remove_subjects'); ?>" method="post" accept-charset="utf-8" name="remove_subjects" class="admin-form" id="remove_subjects">
        <ul class="course-list">
			<?php foreach($db_entries2 as $db_entry):?>
                <li class="input-block">
                <?php 
                    $data = array(
                        'name'        => 'addedcourse[]',
                        'value'       => $db_entry->id,
                    );
                    echo form_checkbox($data).'<span>'.$db_entry->subject_name.'</span>';
                ?>
                </li>
            <?php endforeach;?>
        </ul>
    
    <div class="input-block">
    <?php echo form_submit('remove', 'Remove'); ?>
    </div>
    </form>
<?php else: ?>
<div class="notice">No subjects selected</div>
<?php endif; ?>

</div>

<form action="<?php echo site_url('student/enroll'); ?>" method="post" accept-charset="utf-8" name="enroll" class="admin-form" id="enroll">
	<div class="alignleft">
		<input type="checkbox" value="confirm" name="confirm" id="confirm_chckbox"/> I have read the terms and agreement.
    </div>
	    <input type="submit" value="Enroll" disabled="disabled" id="confirm" class="alignright" />


 </form>
 </div>